;; +lsp-mode.el --- Initialization and mode setting.

;;; Homepage:
;; https://github.com/emacs-lsp/lsp-mode

;;; Commentary:
;; Client for the Language Server Protocol.

;;; Code:

(use-package lsp-mode
  :ensure
  :bind
  (:map lsp-mode-map
	([remap format-all-buffer] . (lambda ()
				       (interactive)
				       (lsp-format-buffer)
				       (lsp-organize-imports)))
	("M-l a" . lsp-execute-code-action)
	("M-l r" . lsp-rename))
  ("C-x C-l s" . lsp-workspace-shutdown)
  ("C-x C-l r" . lsp-workspace-restart)
  ("C-x C-l m" . lsp)
  :init
  (setq lsp-session-file (expand-file-name "lsp/workspaces" spruce-cache-truedirectory)
	lsp-modeline-workspace-status-enable nil
	read-process-output-max (* 10 1024 1024)
	lsp-signature-render-documentation nil
	lsp-headerline-breadcrumb-enable nil
	gc-cons-threshold (* 100 1024 1024))

  (global-unset-key (kbd "C-x C-l"))
  (global-unset-key (kbd "M-l"))
  :config
  (add-to-list 'lsp-signature-auto-activate :after-completion))

(provide '+lsp-mode)

;;; +lsp-mode.el ends here
